package no.gnet.edvd.types;

import org.codehaus.jackson.annotate.JsonIgnore;

public class Option extends Persist{
	public String description;
	public String name;
	public Event event;
	public int event_id;

	

	@Override
	public int hashCode() {
		return name.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		Option other = (Option) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	public String getName() {
		return name;
	}
	
	@JsonIgnore
	public Event getEvent() {
		return event;
	}

	@Override
	public String toString() {
		return "Option [description=" + description + ", name=" + name
				+ ", event=" + (event==null?"null":event.getName()) + ", event_id=" + event_id + ", id=" + id
				+ "]";
	}

	public void setName(String name) {
		this.name = name;
	}
	
}
